package com.usian.pojo.shop;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

@TableName("shop")
public class Shop implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "sid",type = IdType.AUTO)
    private Integer sid;

    @TableField("sname")
    private String sname;

    @TableField("type")
    private String type;

    @TableField("introduce")
    private String introduce;

    @TableField("createTime")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    @TableField("stock")
    private Integer stock;

    //商品状态  1-启用  3-提交审核/待审核  5-审核通过  7-上架  9-下架  11-审核失败
    @TableField("state")
    private Integer state;

    @TableField(exist = false)
    private String cname;

    public Integer getSid() {
        return sid;
    }

    public void setSid(Integer sid) {
        this.sid = sid;
    }

    public String getSname() {
        return sname;
    }

    public void setSname(String sname) {
        this.sname = sname;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getIntroduce() {
        return introduce;
    }


    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    public String getCname() {
        return cname;
    }

    public void setCname(String cname) {
        this.cname = cname;
    }

    public Shop() {
    }

    public Shop(Integer sid, String sname, String type, String introduce, Date createTime, Integer stock, Integer state) {
        this.sid = sid;
        this.sname = sname;
        this.type = type;
        this.introduce = introduce;
        this.createTime = createTime;
        this.stock = stock;
        this.state = state;
    }

    @Override
    public String toString() {
        return "Shop{" +
                "sid=" + sid +
                ", sname='" + sname + '\'' +
                ", type='" + type + '\'' +
                ", introduce='" + introduce + '\'' +
                ", createTime=" + createTime +
                ", stock=" + stock +
                ", state=" + state +
                ", cname='" + cname + '\'' +
                '}';
    }
}